package com.qfedu.controller;

import com.qfedu.model.Project;
import com.qfedu.page.PageResult;
import com.qfedu.page.QueryPageBean;
import com.qfedu.service.ProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author LiJH
 * @date 2023-02-09
 */
@RestController
@RequestMapping("project")
public class ProjectController {

    @Autowired
    private ProjectService projectService;

    @GetMapping("findAll")
    public List<Project> findAll(){
        List<Project> all = projectService.findAll();
        return all;
    }
    @PostMapping("findPage")
    public PageResult findPage(@RequestBody QueryPageBean queryPageBean){
        PageResult page = projectService.findPage(queryPageBean);
        return page;
    }

}